
<div style="width: 100%;padding: 10px;">
    <div style="width: 100%;">
        <table class="table table-striped">
            <thead>
            <tr>
                <th>序号</th>
                <th>类型</th>
                <th>创建时间</th>
                <th>内容</th>
                <th>结果</th>
            </tr>
            </thead>
            <tbody id="index_logs_content">

            </tbody>
        </table>
        <!--分页-->
        <div  style="text-align: center;margin-left: 40%;">
            <ul id="index_logs_content_page"  style="margin: 0;"></ul>
        </div>

    </div>
</div>
<script>
    var indexlogfindlogs = webrootpath+"log/indexlogfindlogs"; //获取日志信息
    $(function () {
        i_L_indexlogfindlogs(1);
    });
    function i_L_indexlogfindlogs(_pagenum) {
        $.get(indexlogfindlogs,{
            pagenum:_pagenum
        },function (content) {
            if(content.code=="1"){

                var datalist = content.data.datalist;
                var htmlstr = "";
                for(var i in datalist){
                    var datalistobj = datalist[i];
                    var logtypestr = "";
                    if(datalistobj.logtype=="10"){
                        logtypestr = "用户";
                    }else if(datalistobj.logtype=="20"){
                        logtypestr = "规则引擎客户端";
                    }
                    //计算需要
                    var xuhao = datalist.length-(_pagenum*parseInt(i));

                    htmlstr+="<tr>\n" +
                                "<td>"+i+"</td>\n" +
                                "<td>"+logtypestr+"</td>\n" +
                                "<td>"+timestampToTime(datalistobj.logdate)+"</td>\n" +
                                "<td>"+datalistobj.logcontent+"</td>\n" +
                                "<td>"+datalistobj.logdesc+"</td>\n" +
                            "</tr>";
                }
                i_L_indexlogfindlogs_page(_pagenum,content.data.pages);
                $("#index_logs_content").html(htmlstr);
            }
        });
    }

    /***
     * 获取分类下词表内容_分页
     */
    function i_L_indexlogfindlogs_page(_pagenum,_pages){
        //处理分页
        $('#index_logs_content_page').bootstrapPaginator({
            currentPage: _pagenum,
            totalPages: _pages,
            size:"normal",
            bootstrapMajorVersion: 3,
            alignment:"right",
            numberOfPages:5,
            itemTexts: function (type, page, current) {
                switch (type) {
                    case "first":
                        return "首页";
                    case "prev":
                        return "上一页";
                    case "next":
                        return "下一页";
                    case "last":
                        return "末页";
                    case "page":
                        return page;
                }
            },
            onPageClicked: function (event, originalEvent, type, page) {
                i_L_indexlogfindlogs(page);
            }
        });
    }



</script>